package com.wclass.controller.app;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.wclass.common.ReturnObject;
import com.wclass.entity.BaseBlogroll;
import com.wclass.service.IBaseBlogrollService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 友情链接 前端控制器
 * </p>
 *
 * @author SEN
 * @since 2019-02-14
 */
@Api(description = "友情链接")
@RestController
@RequestMapping("/blogroll")
public class BlogrollController {
    @Autowired
    private IBaseBlogrollService baseBlogrollService;

    @ApiOperation("获取友情链接列表")
    @RequestMapping(value = "/getBlogrollList", method = RequestMethod.POST)
    public ReturnObject<List<BaseBlogroll>> getBlogrollList() {
        EntityWrapper ew = new EntityWrapper<BaseBlogroll>();
        ew.orderBy("sort");
        return new ReturnObject<>(0, "获取成功", baseBlogrollService.selectList(ew));
    }


}

